package rmi;

import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

public class RmiClient {

    public static void main(String []args) throws RemoteException, NotBoundException {

        Registry registry = LocateRegistry.getRegistry("192.168.57.234",2001);
        UserManagerInterface userManager = (UserManagerInterface)registry.lookup("userManager");
        User user = userManager.getUser();
        System.out.println(user.getName() + ":" + user.getAge());

    }

}
